package edu.winona.csclub.testing.core;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;

public class TestCase implements Iterable<Test>, Iterator<Test> {
	private List<Test>tests;
	private String caseName;
	
	public void setName(String name){
		this.caseName=name;
	}
	public String getName(){
		return caseName;
	}	
	private int cur=0;
	/**
	 * @return the tests
	 */
	public List<Test> getTests() {
		return tests;
	}

	public void addTest(Test t){
		tests.add(t);
	}

	/**
	 * @param tests
	 */
	public TestCase() {
		super();
		this.tests = new LinkedList<Test>();
	}

	public Iterator<Test> iterator() {
		cur=0;
		return this;
	}

	public boolean hasNext() {
		return cur<tests.size();
	}

	public Test next() {
		Test n = tests.get(cur);
		cur++;
		return n;
	}

	public void remove() {
		throw new UnsupportedOperationException("Not Supported");
	}
	
	public String toString(){
		String ret="";
		for( int i = 1; i <= tests.size() ; i++){
			ret+= i + ") "+tests.get(i-1)+"\n";
		}
		return ret;
	}
}
